import { createApp } from 'vue'
import App from './App.vue'
import ElementPlus from 'element-plus'
import router from '@/router'
import 'element-plus/lib/theme-chalk/index.css'
// import '../theme/index.css'

const orderStatus={
    0:'待支付',
    1:'已支付',
    2:'配货完成',
    3:'出库成功',
    4:'交易成功',
    '-1':'手动关闭',
    '-2':'超时关闭',
    '-3':'商家关闭',
}

const app=createApp(App)


//全局方法
app.config.globalProperties.$filters={
    orderMap(status) {
        return orderStatus[status] || '未知状态'
    },
    prefix(url) {
        if(url&&url.startsWith('http')){
            return url
        }else {
            url = `http://backend-api-02.newbee.ltd${url}`
            return url
        }
    }
}

app.config.globalProperties.goTop=function(){
    const main=document.querySelector('.main')
    main.scrollTop=0
}

// console.log(app.config.globalProperties);
// 

// createApp(App).use(router).use(ElementPlus).mount('#app')



app.use(router)
app.use(ElementPlus)
app.mount('#app') 
